

<html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
<style TYPE="text/css">

table { 
	margin: 1em; 
	border-collapse: collapse;
	text-align: center;
	font-family: Verdana;
	font-weight: normal;
	font-size: 11px;
	}
td, th { padding: .3em; border: 1px #ccc solid; }
thead { background: #c8faab; }
tbody { background: #ffffff; }
#highlight tr.hilight { background: #dfffe1; }


td.birdie {
	background-color: #6ecdff;
}
td.eagle {
	background-color: #c4fbff;
}
td.albatross {
	background-color: #ff00f2;
}
td.bogey {
	background-color: #fcf74f;
}
td.doublebogey {
	background-color: #ffb700;
}
td.triplebogey {
	background-color: #ff0000;
}


.button {
    border: 1px solid #006;
    background: #dfffe1;
}





body {
	font-family: Helvetica, Arial, sans-serif;
	font-size: small;		
}

#header {
  background: black url(images/header.jpg) center no-repeat;
  height: 200;
}

</style>
<body>
<div id="header"></div>
Votre carte a été enregistré!


<table width="80%" border="1" align="right">
<thead>
<tr>
</tr>
</thead>
<tbody>
<tr>
<td>Trou</td>
<?php


$host="localhost"; // Host name 
$username="root"; // Mysql username 
$password="root"; // Mysql password 
$db_name="db431888431"; // Database name 

$dbLink = mysql_connect($host, $username, $password);

if (!$dbLink) die("Impossible d'établir une connexion sur la base de données: " . mysql_error());
$dbSelected = mysql_select_db($db_name, $dbLink);
if (!$dbSelected) die ('We\'re connected, but can\'t use the table: ' . mysql_error());

var_dump($POST);

/* if (isset($_POST['register']))
{
	echo "FORMULAIRE RECEPTIONNE!"
	$idparcours = $_POST["idparcours"];
	$idjoueur = $_POST["idjoueur"];
}*/

$query 		= 'SELECT num, par FROM courses_hole WHERE id_course = "' . $idparcours . '" order by num';
$result 	= mysql_query($query);
if(mysql_num_rows($result) ){
	while($row = mysql_fetch_array($result))  {
		echo "<td>". $row['num'] . "</td>";
	}	
}
else {
	echo "aucun parcours trouvé.";
}
?>
</tr>
<tr>
<td>Par</td>
<?php // on recupere les infos du parcours en base
$query 		= 'SELECT num, par FROM courses_hole WHERE id_course = "' . $idparcours . '" order by num';
$result 	= mysql_query($query);
if(mysql_num_rows($result) ){
	while($row = mysql_fetch_array($result))  {
		echo "<td><input style =\"text-align:center\" type=\"text\" readonly=\"true\" name=\"PAR" . $row['par'] ."\" size=\"1\" value=\"" . $row['par'] . "\"></td>";

	}	
}
?>
</tr>
<tr>
<td>Score</td>

<?php // on recupere les infos de $_POST['S'] -- score
	foreach($_POST['S'] as $key=>$score) {
      //Affichage de la value renseignée
      echo "<td>" . $score . "</td>"
      }
?>
</tr>
<tr>
<td>A/P</td>
<?php // on recupere les infos de $_POST['S'] -- score
	foreach($_POST['AP'] as $key=>$ap) {
      //Affichage de la value renseignée
      echo "<td>" . $ap . "</td>"
      }
?>
</tr>

<tr>
<td>Putts</td>
<?php // on recupere les infos de $_POST['S'] -- score
	foreach($_POST['P'] as $key=>$putts) {
      //Affichage de la value renseignée
      echo "<td>" . $putts . "</td>"
      }
?>

</tr>

</tbody>
<tfoot>
</tfoot>
</table>

</body>
</html>